package com.elitesland.core.config;

import com.elitesland.core.config.audit.CustomAuditHandler;

import javax.persistence.PrePersist;
import javax.persistence.PreRemove;
import javax.persistence.PreUpdate;

/**
 * .
 *
 * @author Kaiser（wang shao）
 * @date 2021-03-04
 */
public class CustomAuditingListener {

    private final CustomAuditHandler auditHandler = new CustomAuditHandler();

    @PrePersist
    private void prePersist(Object obj) {
        auditHandler.prePersist(obj);
    }

    @PreUpdate
    private void preUpdate(Object obj) {
        auditHandler.preUpdate(obj);
    }

    @PreRemove
    private void preRemove(Object obj) {
        auditHandler.preRemove(obj);
    }
}
